﻿@model Scrubblet.FrontEnd.Models.GameModel

@{
    ViewBag.Title = "Home Page";
}
@section featured {
    <section class="featured">
@*        <div class="content-wrapper">*@
@*            <hgroup class="title">*@
@*                <h1>@ViewBag.Title.</h1>*@
@*                <h2>@ViewBag.Message</h2>*@
@*            </hgroup>*@
@*            <p>*@
@*                To learn more about ASP.NET MVC visit*@
@*                <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.*@
@*                The page features <mark>videos, tutorials, and samples</mark> to help you get the most from ASP.NET MVC.*@
@*                If you have any questions about ASP.NET MVC visit*@
@*                <a href="http://forums.asp.net/1146.aspx/1?MVC" title="ASP.NET MVC Forum">our forums</a>.*@
@*            </p>*@
@*        </div>*@
    </section>
}

<div id="content-wrapper">
    <div id="left-menu" class="float-left" style="width: 200px">
        @using (Html.BeginForm("NewGame", "Home"))
        {
            <input type="submit" value="New Game" />
        }
        @if (Model.Games.Count == 0)
        {
            <p>You have no games.</p>
        }
        else
        {
            foreach (var game in Model.Games)
            {
                using (Html.BeginForm("Index", "Home"))
                {
                    @Html.ActionLink(game.Name, "Index", new {gameId = game.Id})
                }
            }
        }
    </div>
    <div id="game-area" style="margin:0px 50px 50px 200px;padding:10px;">
        @if (Model.IsNewGame)
        {
            @Html.Partial("_NewGamePartial", Model.NewGameData)
        }
        else
        {
            if (Model.SelectedGame != null)
            {
                @Html.Partial("_GamePartial", Model.SelectedGame)
            }
        }
    </div>
</div>
